﻿using AvaloniaMVVM.Models;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace AvaloniaMVVM.Services
{
    public interface IPoetryStorage
    {
        /// <summary>
        /// 创建表 
        /// </summary>
        /// <returns></returns>
        Task InitializeAsync();

        /// <summary>
        /// 插入
        /// </summary>
        /// <param name="poetry"></param>
        /// <returns></returns>
        Task InsertAsync(Poetry poetry);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="poetry"></param>
        /// <returns></returns>
        Task DeleteAsync(Poetry poetry);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="poetry"></param>
        /// <returns></returns>
        Task UpdateAsync(Poetry poetry);

        /// <summary>
        /// 根据ID
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<Poetry> GetByIdAsync(int id);

        /// <summary>
        /// 查询全部
        /// </summary>
        /// <returns></returns>
        Task<List<Poetry>> GetAllAsync();
    }
}
